home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
t_os
/
gpen32k
/
source.exe
/
LIB
/
OSRC
/
GTH.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-09
|
640b
|
32 lines
/*
複数画面退避サブルーチン
*/
#include <Normlib.h>
#include <okome.h>
void OKM_gth(int x1, int y1, int x2, int y2, int f)
{
static int yz=0;
int i, j, k;
char w[1152];
k = 1152 / (x2-x1+1);
j = (((x2-x1+1)*k+383)/384);
if (f)
{ /* 1:退避 */
for ( i = 0; i <= (y2-y1+k-1)/k; i++ )
{
egbget( x1, y1+i*k, x2, y1+(i+1)*k-1, w );
egbput( 640, yz+j*i, 1023, yz+j*(i+1)-1, w );
}
yz+=(y2-y1+1)*j;
} else { /* 0:復元 */
yz-=(y2-y1+1)*j;
for ( i = 0; i <= (y2-y1+k-1)/k; i++ )
{
egbget( 640, yz+j*i, 1023, yz+j*(i+1)-1, w );
egbput( x1, y1+i*k, x2, y1+(i+1)*k-1, w );
}
}
}